<?php /* D:\phpStudy\PHPTutorial\WWW\laravel-admin\resources\views/admin/goods/goodsShow.blade.php */ ?>
<div id="app">
    <section class="content-header">
        <h1>
            <small>商品查看</small>
        </h1>

    </section>

    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box box-info">
                    <div class="box-header with-border">
                        <div class="box-tools">
                            <div class="btn-group pull-right" style="margin-right: 5px">
                                <a style="margin:0px 5px;" href="/admin/goods/goodsAttr?goods_id=<?php echo e($goods['goods_id'], false); ?>" class="btn btn-sm btn-default" title="规格"> <span class="hidden-xs">规格</span></a>
                                <a style="margin:0px 5px;" href="/admin/goods/goodsAddImg?goods_id=<?php echo e($goods['goods_id'], false); ?>" class="btn btn-sm btn-default" title="图片"> <span class="hidden-xs">图片</span></a>
                                <a style="margin:0px 5px;" href="/admin/goods/sku?goods_id=<?php echo e($goods['goods_id'], false); ?>" class="btn btn-sm btn-default" title="属性"> <span class="hidden-xs">属性</span></a>
                                <a style="margin:0px 5px;" href="/admin/goods/goodsLease?goods_id=<?php echo e($goods['goods_id'], false); ?>}" class="btn btn-sm btn-default" title="租期"> <span class="hidden-xs">租期</span></a>
                            </div>
                        </div>


  <span>
    <a class="btn btn-sm btn-primary grid-refresh" title="刷新"><i class="fa fa-refresh"></i><span class="hidden-xs"> 刷新</span></a>
    
  </span>
                    </div>


                    <h3 style="background: #0d6aad;color:#f9f9f9;text-align:center;width:300px;padding:5px;">商品基本信息</h3>
                    <form id="addForm" action="/admin/goods/goodsEdit" method="post" accept-charset="UTF-8" class="form-horizontal" enctype="multipart/form-data" pjax-container>
                        <div class="box-body">
                            <div class="fields-group">

                                <div class="form-group  ">
                                    <label for="supplier_id" class="col-sm-2  control-label">供应商</label>
                                    <div class="col-sm-8">
                                         <?php echo e($supplier['name'], false); ?>

                                    </div>
                                </div>

                                <div class="form-group  ">
                                    <label for="brand_id" class="col-sm-2  control-label">品牌名称</label>
                                    <div class="col-sm-8">
                                        <?php echo e($brand['brand_name'], false); ?>

                                    </div>
                                </div>

                                <div class="form-group  ">
                                    <label for="cate_id" class="col-sm-2  control-label">商品分类</label>
                                    <div class="col-sm-8">
                                        <?php echo e($category['cate_name'], false); ?>

                                    </div>
                                </div>

                                <div class="form-group  ">
                                    <label for="goods_name" class="col-sm-2  control-label">商品名称</label>
                                    <div class="col-sm-8">
                                        <?php echo e($goods['goods_name'], false); ?>

                                    </div>
                                </div>


                                <div class="form-group  ">
                                    <label for="keywords" class="col-sm-2  control-label">商品关键词</label>
                                    <div class="col-sm-8">
                                        <?php echo e($goods['keyword'], false); ?>

                                    </div>
                                </div>

                                <div class="form-group  ">
                                    <label for="detail" class="col-sm-2  control-label">商品描述</label>
                                    <div class="col-sm-8">
                                        <?php echo e($goods['detail'], false); ?>

                                    </div>
                                </div>

                                <div class="form-group  ">
                                    <label for="goods_sale_phone" class="col-sm-2  control-label">售后电话</label>
                                    <div class="col-sm-8">
                                        <?php echo e($goods['goods_sale_phone'], false); ?>


                                    </div>
                                </div>




                                <div class="form-group  ">
                                    <label for="goods_img_list" class="col-sm-2  control-label">商品列表图片</label>
                                    <div class="col-sm-8">
                                        <img width="200" src="<?php echo e($goods['goods_img_list'], false); ?>">
                                    </div>
                                </div>

                                <div class="form-group  ">
                                    <label for="goods_order_thumbnail" class="col-sm-2  control-label">订单缩略图</label>
                                    <div class="col-sm-8">
                                        <img width="200" src="<?php echo e($goods['goods_order_thumbnail'], false); ?>">
                                    </div>
                                </div>

                                <div class="form-group  ">
                                    <label for="goods_price" class="col-sm-2  control-label">商品价格</label>
                                    <div class="col-sm-8">
                                        <?php echo e(number_deal($goods['goods_price']), false); ?>


                                    </div>
                                </div>
                                <div class="form-group  ">
                                    <label for="goods_official_price" class="col-sm-2  control-label">官方价格</label>
                                    <div class="col-sm-8">
                                        <?php echo e(number_deal($goods['goods_official_price']), false); ?>


                                    </div>
                                </div>

                                <div class="form-group  ">
                                    <label for="goods_purchase_price" class="col-sm-2  control-label">进货价</label>
                                    <div class="col-sm-8">
                                        <?php echo e(number_deal($goods['goods_purchase_price']), false); ?>

                                    </div>
                                </div>


                                <div class="form-group  ">
                                    <label for="is_required" class="col-sm-2  control-label">配件费用</label>
                                    <div class="col-sm-8">
                                        <?php echo e(number_deal($goods['goods_installation_charge']), false); ?>

                                    </div>
                                </div>

                                <div class="form-group  ">
                                    <label for="goods_purchase_price" class="col-sm-2  control-label">配件费用是否可选</label>
                                    <div class="col-sm-8">
                                        <?php if($goods['is_required']==1): ?> 可选 <?php else: ?> 必选  <?php endif; ?>
                                    </div>
                                </div>
                                <div class="form-group  ">
                                    <label for="goods_purchase_price" class="col-sm-2  control-label">配件费用说明</label>
                                    <div class="col-sm-8">
                                        <?php echo e($goods['goods_installation_show'], false); ?>

                                    </div>
                                </div>



                                <div class="form-group  ">
                                    <label for="is_required" class="col-sm-2  control-label">意外保障费</label>
                                    <div class="col-sm-8">
                                        <?php echo e(number_deal($goods['goods_insurance']), false); ?>

                                    </div>
                                </div>

                                <div class="form-group  ">
                                    <label for="goods_purchase_price" class="col-sm-2  control-label">意外保障费是否可选</label>
                                    <div class="col-sm-8">
                                        <?php if($goods['is_required_insurance']==1): ?> 可选 <?php else: ?> 必选  <?php endif; ?>
                                    </div>
                                </div>


                            </div>
                        </div>

                    </form>



                    <h3 style="background: #0d6aad;color:#f9f9f9;text-align:center;width:300px;padding:5px;">商品规格参数</h3>
                    <div class="box-body table-responsive no-padding">
                        <table class="table-hover" style="width:80%;">
                            <?php if($attr): ?>
                                <?php $__currentLoopData = $attr; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $v): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td  style="padding:10px 10px;">
                                            参数名：<input type="text" value="<?php echo e($v['attr_spec_name'], false); ?>" class="spec_name<?php echo e($v['id'], false); ?>" style="padding-left:5px;border:1px solid #a6e1ec;height:40px;width:500px;"/>
                                            参数值：<input type="text" value="<?php echo e($v['attr_spec_val'], false); ?>" class="spec_val<?php echo e($v['id'], false); ?>" style="padding-left:5px;border:1px solid #a6e1ec;height:40px;width:500px;"/>
                                        </td>

                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php else: ?>
                                <tr>
                                    <td style="background:#eee;text-align: center;padding:10px;">无规格参数</td>
                                </tr>
                            <?php endif; ?>

                        </table>
                    </div>
                    <h3 style="background: #0d6aad;color:#f9f9f9;text-align:center;width:300px;padding:5px;">商品属性</h3>
                    <table class=" table-hover" style="width:80%">
                        <thead >
                        <tr >
                            <th style="padding:10px 10px;">属性名/属性值</th>
                            <th style="padding:10px 10px;">属性图片</th>

                        </tr>
                        </thead>
                        <?php if($sku): ?>
                            <?php $__currentLoopData = $sku; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $v): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr  class="attr_type<?php echo e($v['attr_id'], false); ?>">
                                    <td colspan="2" style="padding:10px 10px;" >
                                        属性名：<input type="text" id="attr_type<?php echo e($v['attr_id'], false); ?>" style="height:30px;border:1px solid #adadad;width:400px;padding-left:5px;" value="<?php echo e($v['attr_type'], false); ?>">
                                    </td>

                                </tr>
                                <?php if($v['zhi']): ?>
                                    <?php $__currentLoopData = $v['zhi']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $vv): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr class="attr_type<?php echo e($v['attr_id'], false); ?>  attr_val<?php echo e($vv['id'], false); ?>">
                                            <td style="text-align: center;padding:10px 10px;">

                                                    属性值：  <input type="text" id="attr_val<?php echo e($vv['id'], false); ?>" value="<?php echo e($vv['attr_name'], false); ?>" style="height:30px;border:1px solid #a1cbef;width:400px;padding-left:5px;">

                                            </td>
                                            <td style="padding:10px 10px;">
                                                <img class="attr_img<?php echo e($vv['id'], false); ?>" data-action="zoom" width="100" src="<?php echo e($url, false); ?><?php echo e($vv['attr_img'], false); ?>" />
                                            </td>

                                        </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                <?php endif; ?>

                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php endif; ?>

                    </table>
                    <h3 style="background: #0d6aad;color:#f9f9f9;text-align:center;width:300px;padding:5px;">商品SKU</h3>
                    <table class=" table-hover" style="width:80%;">
                        <thead >
                        <tr >
                            <th style="padding:10px 10px;">商品名称</th>
                            <th style="padding:10px 10px;">商品sku</th>
                            <th style="padding:10px 10px;">商品价格(元)</th>
                            <th style="padding:10px 10px;">官方价格(元)</th>
                            <th style="padding:10px 10px;">进货价(元)</th>

                        </tr>
                        </thead>

                        <tbody>

                        <?php if($goods_sku): ?>
                            <?php $__currentLoopData = $goods_sku; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $v): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr >
                                    <td style="padding:10px 10px;">
                                        <?php echo e($v['goods_name'], false); ?>

                                    </td>
                                    <td style="padding:10px 10px;">
                                        <?php echo e($v['sku_str'], false); ?>

                                    </td>
                                    <td style="padding:10px 10px;">
                                        <?php echo e($v['goods_price'], false); ?>

                                    </td>
                                    <td style="padding:10px 10px;">
                                        <?php echo e($v['goods_official_price'], false); ?>

                                    </td>
                                    <td style="padding:10px 10px;">
                                        <?php echo e($v['goods_purchase_price'], false); ?>

                                    </td>

                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php endif; ?>
                        </tbody>
                    </table>
                    <h3 style="background: #0d6aad;color:#f9f9f9;text-align:center;width:300px;padding:5px;">商品租期</h3>
                    <table class="table-hover" style="width:80%;">
                        <thead >
                        <tr >
                            <th style="padding:10px 10px;">租期id </th>
                            <th style="padding:10px 10px;">商品id </th>
                            <th style="padding:10px 10px;">商品名称</th>
                            <th style="padding:10px 10px;">商品sku</th>
                            <th style="padding:10px 10px;">租期数</th>
                            <th style="padding:10px 10px;">总租金</th>
                            <th style="padding:10px 10px;">押金</th>
                            <th style="padding:10px 10px;">买断金</th>
                        </tr>
                        </thead>

                        <tbody>

                        <?php if(!empty($goods_lease)): ?>
                            <?php $__currentLoopData = $goods_lease; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $v): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr style="background:#abcdef;font-size:18px;">
                                    <td style="padding:10px 10px;">
                                        <?php echo e($v['id'], false); ?>

                                    </td>
                                    <td style="padding:10px 10px;">
                                        <?php echo e($v['goods_id'], false); ?>

                                    </td>
                                    <td style="padding:10px 10px;">
                                        <?php echo e($goods['goods_name'], false); ?>

                                    </td>
                                    <td style="padding:10px 10px;">
                                        <?php echo e($v['sku_str'], false); ?>

                                    </td>
                                    <td style="padding:10px 10px;">
                                        <?php echo e($v['term_num'], false); ?>

                                    </td>
                                    <td >
                                        <?php echo e($v['rent_price'], false); ?>

                                    </td>
                                    <td style="padding:10px 10px;">
                                        <?php echo e($v['deposit_price'], false); ?>

                                    </td>
                                    <td style="padding:10px 10px;">
                                        <?php echo e($v['buyout_price'], false); ?>

                                    </td>
                                </tr>
                                <?php if($v['term']): ?>
                                    <?php $__currentLoopData = $v['term']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $kk=> $vv): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr>
                                            <td style="padding:10px 10px;" colspan="3">第<?php echo e($kk+1, false); ?>期</td>
                                            <td style="padding:10px 10px;" colspan="3">本期天数：<?php echo e($vv['day_num'], false); ?></td>
                                            <td style="padding:10px 10px;" colspan="3">本期租金：<?php echo e($vv['price'], false); ?></td>
                                        </tr>

                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                <?php endif; ?>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php endif; ?>
                        </tbody>
                    </table>

                    <h3 style="background: #0d6aad;color:#f9f9f9;text-align:center;width:300px;padding:5px;">商品图片</h3>
                    <table class=" table-hover" style="width:80%; border:0px; display:'';" >

                        <tr>
                            <td style="text-align: center;padding:10px 10px;">商品轮播图</td>
                            <td>
                                <?php if($img): ?>
                                    <?php $__currentLoopData = $img; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $v): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <?php if($v['img_type']==1): ?>
                                            <div style="margin-bottom: 5px;">
                                                <img data-action="zoom" width="300" src="<?php echo e($url, false); ?><?php echo e($v['img_src'], false); ?>"  />
                                            </div>
                                        <?php endif; ?>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                <?php endif; ?>
                            </td>
                        </tr>

                        <tr>
                            <td style="text-align: center;padding:10px 10px;">商品详情图</td>
                            <td style="padding:10px 10px;">
                                <?php if($img): ?>
                                    <?php $__currentLoopData = $img; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $v): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <?php if($v['img_type']==2): ?>
                                            <div style="margin-bottom: 5px;">
                                                <img data-action="zoom" width="300" src="<?php echo e($url, false); ?><?php echo e($v['img_src'], false); ?>"  />
                                            </div>
                                        <?php endif; ?>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                <?php endif; ?>
                            </td>
                        </tr>
                    </table>


                </div>

            </div></div>
    </section>
</div>
<script data-exec-on-popstate>
    $(function () {
        $("#cate_id").val("<?php echo e($goods['cate_id'], false); ?>");
        $("#brand_id").val("<?php echo e($goods['brand_id'], false); ?>");
        $("#supplier_id").val("<?php echo e($goods['supplier_id'], false); ?>");


        $('.goods_price').inputmask({"alias":"currency","radixPoint":".","prefix":"","removeMaskOnSubmit":true});
        $('.goods_official_price').inputmask({"alias":"currency","radixPoint":".","prefix":"","removeMaskOnSubmit":true});
        $('.goods_purchase_price').inputmask({"alias":"currency","radixPoint":".","prefix":"","removeMaskOnSubmit":true});
        $('.goods_installation_charge').inputmask({"alias":"currency","radixPoint":".","prefix":"","removeMaskOnSubmit":true});
        $('.goods_insurance').inputmask({"alias":"currency","radixPoint":".","prefix":"","removeMaskOnSubmit":true});
        $("input.goods_img_list").fileinput({"overwriteInitial":true,"initialPreviewAsData":true,"browseLabel":"\u6d4f\u89c8","showRemove":false,"showUpload":false,"dropZoneEnabled":false,
             "allowedFileTypes":["image"]});
        $("input.goods_order_thumbnail").fileinput({"overwriteInitial":true,"initialPreviewAsData":true,"browseLabel":"\u6d4f\u89c8","showRemove":false,"showUpload":false,"dropZoneEnabled":false,
            "allowedFileTypes":["image"]});


        //刷新
        $('.grid-refresh').on('click', function() {
            $.pjax.reload('#pjax-container');
            toastr.success('刷新成功 !');
        });
    });

</script>